﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Config_App
{
    /// <summary>
    /// Form zum einstellen der Parameter, welche für die Erzeugung von Wiedersprüchen benötigt werden
    /// </summary>
    public partial class frm_wiedersprueche : Form
    {
        public int Bits_p_EM = 0;
        public int Bits_p_AM = 0;
        public int Anz_EM = 0;
        public int anz_MP = 0;
        public int anz_oneBit_AM = 0;

        public frm_wiedersprueche()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Beendet den Dialog mit Cancel
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _b_abbrechen_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        /// <summary>
        /// Beendet den Dialog mit OK und setzt die Parameter
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _b_ok_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Sind Sie sicher was Sie tun?\r\nWirklich fortfahren?", "", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
            {
                this.Bits_p_EM = Convert.ToInt32(this._nud_anz_inpm.Value);
                this.Bits_p_AM = Convert.ToInt32(this._nud_anz_outm.Value);
                this.Anz_EM = Convert.ToInt32(this._nud_anz_inp.Value);
                this.anz_MP = Convert.ToInt32(this._nud_anz_mp.Value);
                this.anz_oneBit_AM = Convert.ToInt32(this._nud_onebit_EM.Value);

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }
    }
}
